﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true" CodeBehind="AddAlbum.aspx.cs" Inherits="Baby.GrowUp.Web.Admin.AddAlbum" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link href="css/ckbox.css" rel="stylesheet" />
    <script type="text/javascript">
        $(function () { $('[data-toggle="tooltip"]').tooltip() });

        function back() {
            if (confirm('确定放弃保存返回吗？')) {
                window.location.href = 'AlbumManager.aspx';
            }
        }

        function checkInput() {
            var ret = true;
            if ($('#txtTitle').val() == '') {
                $('#txtTitle').tooltip('show');
                ret = false;
            }
            if ($('#imgCoverPath').val() == '') {
                $('#imgCoverPath').tooltip('show');
                ret = false;
            }
            if ($('#txtDetail').val() == '') {
                $('#txtDetail').tooltip('show');
                ret = false;
            }
            return ret;
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div>
        <h1>新增宝贝相册</h1>
        <hr />
        <div class="container">
            <div class="form-horizontal">
                <div class="form-group">
                    <label class="col-sm-2 control-label">相册名称</label>
                    <div class="col-sm-10">
                        <asp:TextBox runat="server" ID="txtTitle" CssClass="form-control" ClientIDMode="Static" title="请输入相册名称！" data-toggle="tooltip" data-placement="left"></asp:TextBox>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">封面图片</label>
                    <div class="col-sm-10">
                        <asp:FileUpload runat="server" ID="imgCoverPath" CssClass="form-control" ClientIDMode="Static" title="请选择相册封面！" data-toggle="tooltip" data-placement="left" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">相册说明</label>
                    <div class="col-sm-10">
                        <asp:TextBox runat="server" ID="txtDetail" CssClass="form-control" TextMode="MultiLine" Rows="3" ClientIDMode="Static" title="请输入相册说明！" data-toggle="tooltip" data-placement="left"></asp:TextBox>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">是否私有</label>
                    <div class="col-sm-10" style="padding-top: 5px;">
                        <input type="checkbox" id="isPrivate" runat="server" clientidmode="Static" class="chk_1" />
                        <label for="isPublic"></label>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-offset-2 col-sm-10">
                        <asp:Button runat="server" ID="btnSave" CssClass="btn btn-primary" Text="保存相册" OnClientClick="return checkInput()" OnClick="SaveAlbum" />
                        <a class="btn btn-danger" href="javascript:back()">取消</a>
                    </div>
                </div>
            </div>
        </div>
    </div>
</asp:Content>
